﻿using System;
using System.Data;
using com.pro2e.console.service.auth.vo;
using com.pro2e.console.generic.util;
using System.Data.SqlClient;
using System.Collections.Generic;
using com.pro2e.web.config.init;
using NHibernate;
using System.Collections;
using com.pro2e.console.core.valueobject;
using NHibernate.Criterion;


/// <summary>
/// LoginRolesDao 的摘要描述
/// </summary>
/// 

namespace com.pro2e.console.service.auth.dao
{
    public class LoginRoleDao : DaoImp
    {
        public IList<LoginRole> GetVOsByName(string roleName)
        {

            ICriteria criteria = GetHBNSession().CreateCriteria(typeof(LoginRole));
            criteria.Add(Expression.Like("RoleName", roleName, MatchMode.Anywhere));

            IList<LoginRole> result = criteria.List<LoginRole>();

            if (result != null && result.Count > 0)
            {
                return result;
            }
            else
            {
                return null;
            }

        }

    }
}

